<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/fabric@4.6.0/dist/fabric.min.js"></script>
  <style>
    img {
      display: none;
    }
  </style>
</head>
<body>
  <!-- <img src="https://img1.baidu.com/it/u=3206351602,2714439067&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500" alt=""> -->
  <!-- <img src="./assets/imgs/Snipaste_2022-10-25_11-11-58.png" alt=""> -->
  <canvas width="800" height="600" id="canvas" style="border: 1px solid #ccc;"></canvas>
  <img id="logo" src="./assets/imgs/Snipaste_2022-10-25_11-11-58.png" alt="">
  <script>
    const canvas = new fabric.Canvas('canvas')
    const imgElement = document.getElementById('logo')
    imgElement.onload = function() {
      let imgInstance = new fabric.Image(imgElement, {
        left: 200,
        top: 100,
        width: 200,
        height: 200,
        angle: 50, // 旋转
      })
      canvas.add(imgInstance)
    }
  </script>
</body>
</html>